//
//  LYWithDrawLabelCell.m
//  SelectCity
//
//  Created by liuyan on 2019/3/31.
//  Copyright © 2019年 liuyan. All rights reserved.
//

#import "LYWithDrawLabelCell.h"

@interface LYWithDrawLabelCell()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView *nextImage;

@end

@implementation LYWithDrawLabelCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubViews];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

#pragma mark - InitSubViews
- (void)initSubViews{
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, WIDTH - 30, 15)];
    self.titleLabel.font = [UIFont systemFontOfSize:12];
    self.titleLabel.textColor = RGB(34, 34, 34);
    [self.contentView addSubview:self.titleLabel];
    
    self.detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, self.titleLabel.bottom+5, WIDTH - 30, 30)];
    self.detailLabel.font = [UIFont boldSystemFontOfSize:16];
    self.detailLabel.textColor = RGB(34, 34, 34);
    [self.contentView addSubview:self.detailLabel];
    
    self.nextImage = [[UIImageView alloc] initWithFrame:CGRectMake( WIDTH - 8 - 15, 22, 8, 16)];
    self.nextImage.image = [UIImage imageNamed:@"icon_open"];
    self.nextImage.hidden = YES;
    [self.contentView addSubview:self.nextImage];
    
    UIView *line = [[UIView alloc] initWithFrame:CGRectMake(15, 59, WIDTH - 30, 1)];
    line.backgroundColor = RGB(247, 247, 247);
    [self.contentView addSubview:line];
}

- (void)setTitle:(NSString *)title isClicked:(BOOL)isClick{
    _titleLabel.text = title;
    if (isClick) {
        self.nextImage.hidden = NO;
    }else{
        self.nextImage.hidden = YES;
    }
}



@end
